<?php
namespace app\admin\controller;
use app\admin\controller\Base;
use think\Controller;

class Index extends Base
{
    public function index()
    {

        $user = session(config('admin.session_user'), '', config('admin.session_user_scope'));
        return view('index', ['user' => $user]);

    }
    public function home()
    {
        $yu_total = model('Products')->getProductsCountByCondition([]);
        $goods_total = model('goods')->getGoodsCountByCondition([]);
        return $this->fetch('',['yu_total'=> $yu_total,
        'goods_total'=>$goods_total
        ]);

    }

    public  function search()
    {
        $data = input('param.');
        return var_dump($data);
    }
    public function category_manage()
    {
        $place=model('Place')->select();
        $mater=model('Mater')->select();
        $fishing=model('Fishing')->select();
        $tail=model('Tail')->select();
        return $this->fetch('', ['place'=> $place,
            'mater'=>$mater,
            'fishing'=>$fishing,
            'tail'=>$tail]);
    }
    public function product_category_add()
    {
        return $this->fetch();
    }
    public function login()
    {
        session(null, config('admin.session_user_scope'));
        // 跳转
        $this->redirect('login/index');
    }


}

